﻿using FinalPointSet.Model.Model.FieldMapping;
using System.Collections.ObjectModel;

namespace FinalPointSet.Model.Model
{
    /// <summary>
    /// 数据源
    /// </summary>
    public class DataSource
    {
        /// <summary>
        /// 排序
        /// </summary>
        public int Sequence { get; set; } = 0;
        /// <summary>
        /// 名称
        /// </summary>
        public string Name { get; set; } = string.Empty;
        /// <summary>
        /// 图标路径
        /// </summary>
        public string LogoPath { get; set; } = string.Empty;
        /// <summary>
        /// 字段类型
        /// </summary>
        public ObservableCollection<DataSourceFieldType> FieldTypes { get; set; } = [];

        public override bool Equals(object? obj)
        {
            return obj is DataSource source && Name.Equals(source.Name);
        }

        public override int GetHashCode()
        {
            return base.GetHashCode();
        }
    }
}
